package cn.com.aiouyi.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;

/**
 * Entity - 导航位
 * @author hanson
 *
 */
@Getter
@Setter
@Entity
@Table(name = "t_navigation_position")
public class NavigationPosition extends BaseEntity<Long>{

	private static final long serialVersionUID = 1L;

	/** 代码枚举 */
	public enum Code {
		/** 顶部导航 */
		top,
		/** 首页中部导航 */
		indexCenter,
		/** 详情页导航 */
		pageNavi;
	}
	
	/** 名称 */
	private String name;
	
	/** 代码 */
	@Column(unique = true)
	@Enumerated(EnumType.STRING)
	private Code code;
	
	/** 描述 */
	private String description;
	
	/** 导航列表 */
	@OneToMany(mappedBy="navigationPosition")
	private List<Navigation> navigations = new ArrayList<Navigation>();
}
